﻿@model List<etracks.Web.ResourceReadOnlyViewModel>

@if ((Model == null) || (Model.Count <= 0))
{
    <p>No records found.</p>
    return;
}

<table class="table table-hover table-striped">

    <thead>
        <tr>
            <th class="col-md-1">Id</th>
            <th class="col-md-3">Name</th>
            <th class="col-md-3">
                @Html.ActionLink(" ", "Edit", "Resource", new { id = 0 }, new { @class = "glyphicon glyphicon-edit", style = "text-decoration:none;" })
                Type
            </th>
            <th class="col-md-5"></th>
        </tr>
    </thead>

    <tbody>

        @foreach (etracks.Web.ResourceReadOnlyViewModel Resource in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink(" ", "Edit", "Resource", new { id = Resource.Id }, new { @class = "glyphicon glyphicon-edit", style = "text-decoration:none;" })
                    @Resource.Id
                </td>
                <td>
                    @Html.ActionLink(Resource.Name, "View", "Resource", new { id = Resource.Id }, new { style="text-decoration:none" })
                    @if (!string.IsNullOrEmpty(Resource.Alias)) { 
                        string.Format("({0})", Resource.Alias); 
                    }
                </td>
                <td>
                    @DataHelper.IfNull(Resource.ResourceType)
                </td>
                <td></td>
            </tr>
        }

    </tbody>

</table>